package org.example.springmvc.pojo;

import java.util.*;

/**
 * ClassName: Person
 * Package: org.example.springmvc.pojo
 * Description:
 *
 * @Author wanghao
 * @Create 2024-07-11 10:04
 * @Version 1.0
 */
public class Person {

    private String pid;

    private String pname;

    private Integer age;

    private String address;

    private Car car;

    private Car[] carArr;

    private List<Car> carList;

    private Map<String, String> map;

    private Set<Car> carSet = new HashSet<>();  // 此处必须初始化

    public Person() {
        // 此处必须给set设置好初始的元素
        Car c1 = new Car();
        Car c2 = new Car();
        carSet.add(c1);
        carSet.add(c2);
    }

    public String getPid() {
        return pid;
    }

    public void setPid(String pid) {
        this.pid = pid;
    }

    public String getPname() {
        return pname;
    }

    public void setPname(String pname) {
        this.pname = pname;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public Car getCar() {
        return car;
    }

    public void setCar(Car car) {
        this.car = car;
    }

    public Car[] getCarArr() {
        return carArr;
    }

    public void setCarArr(Car[] carArr) {
        this.carArr = carArr;
    }

    public List<Car> getCarList() {
        return carList;
    }

    public void setCarList(List<Car> carList) {
        this.carList = carList;
    }

    public Map<String, String> getMap() {
        return map;
    }

    public void setMap(Map<String, String> map) {
        this.map = map;
    }

    public Set<Car> getCarSet() {
        return carSet;
    }

    public void setCarSet(Set<Car> carSet) {
        this.carSet = carSet;
    }

    @Override
    public String toString() {
        return "Person{" +
                "pid='" + pid + '\'' +
                ", pname='" + pname + '\'' +
                ", age=" + age +
                ", address='" + address + '\'' +
                ", car=" + car +
                ", carArr=" + Arrays.toString(carArr) +
                ", carList=" + carList +
                ", map=" + map +
                ", carSet=" + carSet +
                '}';
    }
}
